fix(npm): stop skipping dependency subtree when root entry has no version#423
Merged
Conversation
ruromero
commented
Apr 16, 2026
Collaborator
Author
Verification Report for TC-4128 (commit 154847e)
Overall: WARNThe only non-PASS result is the CI gradle-groovy integration test failure, which is caused by a transient 504 timeout from the rhtpa staging backend — completely unrelated to this PR's npm/pnpm fix. All unit tests, spotless checks, and 33/36 integration test suites pass. Acceptance Criteria Detail:
This comment was AI-generated by sdlc-workflow/verify-pr v0.6.1. |
a-oren
reviewed
Apr 19, 2026
…sion In addDependenciesFromKey(), a null version check caused an early return that skipped both the versionless entry and its entire transitive dependency subtree. This affected file: deps, workspace packages, and linked packages. Now null version produces a versionless PURL and always recurses into children, matching the JS client behavior. Implements TC-4128 Assisted-by: Claude Code
The deps_with_no_version_root_dep fixture directory was not staged in the previous commit, causing a NullPointerException in CI when the test tried to load the resource files. Implements TC-4128 Assisted-by: Claude Code
Signed-off-by: Ruben Romero Montes <rromerom@redhat.com>
a-oren
approved these changes
Apr 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
JavaScriptProvider.addDependenciesFromKey()which skipped both the entry and its entire transitive dependency subtree when a root-level dependency had no version field (e.g.,file:deps, workspace packages, linked packages)_addDependenciesToSbom()behaviorRoot cause
The null-version check at line 181 did
returninside aforEachRemaininglambda, which exited the lambda body entirely — skipping both thesbom.addDependency()call and theaddDependenciesOf()recursion for that entry's children.Fix
Replace the early-return guard with a null-safe version extraction that passes
nulltotoPurl()(valid per PURL spec — version is optional), then unconditionally recurses into children.Implements TC-4128
Test plan
test_provideStack_includes_deps_of_root_entry_without_versionpasses (7 components)🤖 Generated with Claude Code